<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
</head>
<body>
this is index file

<script>
    function login() {
        $.ajax({
            url: 'http://ssp-yii.deepleaper.com/index/login',
            xhrFields: {withCredentials: true},
            data: {
                "role": "media",
                "platform_role": "alliance",
                "username": "testmedia@126.com",
                "password": "Deepleaper8888"
            },
            'type': 'post'
        }).then(function (r) {
            console.log(r)
        }, function (r) {
            console.error(r)
        });
    }

    function getAuthority() {
        $.ajax({
            url: 'http://ssp-yii.deepleaper.com/user/getcurrentuserauthority',
            xhrFields: {withCredentials: true}
        }).then(function (res) {
            console.log(res);
        }, function (res) {
            console.error(res);
        })
    }

    login();
    getAuthority();
</script>
</body>
</html>